<?php

function redirect($url, $time = 0) {
	if ($time === 0) { // Compatible sans js
		echo '
		<script type="text/javascript">
		window.location="'.$url.'";
		</script>
		<noscript>
		<div align="center"><strong>Redirection....</strong></div>
		<meta http-equiv="refresh" content="1;URL='.$url.'">
		</noscript>
		';
		die();
	 } elseif ($time > 0) {
		$time *= 1000;
		echo '
		<div align="center"><strong>Redirection....</strong></div>
		<script type="text/javascript">
		function redirection(page)
		{window.location=page;}
		setTimeout(\'redirection("'.$url.'/")\','.$time.'); </script>
		<noscript>
		<meta http-equiv="refresh" content="'.$time.';URL='.$url.'">
		</noscript>
		';
		die();
	} else {
		die('Redirection impossible !');
	}

}
?>